home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / vidhrdw / bsktball.c < prev    next >
C/C++ Source or Header  |  1998-07-13  |  2KB  |  77 lines

  1. /***************************************************************************
  2.  
  3.   vidhrdw.c
  4.  
  5.   Functions to emulate the video hardware of the machine.
  6.  
  7. ***************************************************************************/
  8.  
  9. #include "driver.h"
  10. #include "vidhrdw/generic.h"
  11.  
  12. unsigned char *bsktball_motion;
  13.  
  14. /***************************************************************************
  15.  
  16.   Draw the game screen in the given osd_bitmap.
  17.   Do NOT call osd_update_display() from this function, it will be called by
  18.   the main emulation engine.
  19.  
  20. ***************************************************************************/
  21. void bsktball_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
  22. {
  23.     int offs,motion;
  24.  
  25.     /* for every character in the Video RAM, check if it has been modified */
  26.     /* since last time and update it accordingly. */
  27.     for (offs = videoram_size - 1;offs >= 0;offs--)
  28.     {
  29.                 if (dirtybuffer[offs])
  30.                 {
  31.                         int charcode;
  32.                         int sx,sy;
  33.                         int flipx;
  34.                         int color;
  35.  
  36.                         dirtybuffer[offs]=0;
  37.  
  38.                         charcode = videoram[offs];
  39.  
  40.                         color = (charcode & 0x40) >> 6;
  41.                         flipx = (charcode & 0x80) >> 7;
  42.  
  43.                         charcode = ((charcode & 0x0F) << 2) | ((charcode & 0x30) >> 4);
  44.  
  45.                         sx = 8 * (offs % 32);
  46.                         sy = 8 * (offs / 32);
  47.                         drawgfx(tmpbitmap,Machine->gfx[0],
  48.                                 charcode, color,
  49.                                 flipx,0,sx,sy,
  50.                     &Machine->drv->visible_area,TRANSPARENCY_NONE,0);
  51.                 }
  52.     }
  53.  
  54.     /* copy the character mapped graphics */
  55.     copybitmap(bitmap,tmpbitmap,0,0,0,0,&Machine->drv->visible_area,TRANSPARENCY_NONE,0);
  56.  
  57.     for (motion=0;motion<16;motion++)
  58.     {
  59.         int pic,sx,sy,color,flipx;
  60.  
  61.         pic = bsktball_motion[motion*4];
  62.         sy = 28*8 - bsktball_motion[motion*4 + 1];
  63.         sx = bsktball_motion[motion*4 + 2];
  64.         color = bsktball_motion[motion*4 + 3];
  65.  
  66.         flipx = (pic & 0x80) >> 7;
  67.         pic = (pic & 0x3F);
  68.         color = (color & 0x3F);
  69.  
  70.         drawgfx(bitmap,Machine->gfx[1],
  71.                 pic, color,
  72.                 flipx,0,sx,sy,
  73.                 &Machine->drv->visible_area,TRANSPARENCY_PEN,0);
  74.     }
  75. }
  76.  
  77.